using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class CTPhieuHangTraManagement
	{
	
		public ResultObj SaveNewCTPhieuHangTra(CTPhieuHangTra ctphieuhangtra)
        		{
			ResultObj result = new ResultObj();
			ctphieuhangtra.Id = -1;
			CTPhieuHangTraDAO ctphieuhangtraDAO = new CTPhieuHangTraDAO();
			result = ctphieuhangtraDAO.SaveCTPhieuHangTra(ctphieuhangtra);
			
			return result;
		}
		
		public ResultObj UpdateCTPhieuHangTra(CTPhieuHangTra ctphieuhangtra)
        		{
			ResultObj result = new ResultObj();
			CTPhieuHangTraDAO ctphieuhangtraDAO = new CTPhieuHangTraDAO();
			result = ctphieuhangtraDAO.SaveCTPhieuHangTra(ctphieuhangtra);
			
			return result;
		}
		
		public ResultObj DeleteCTPhieuHangTra(CTPhieuHangTra ctphieuhangtra)
        		{
			ResultObj result = new ResultObj();
			CTPhieuHangTraDAO ctphieuhangtraDAO = new CTPhieuHangTraDAO();
			result = ctphieuhangtraDAO.DeleteCTPhieuHangTra(ctphieuhangtra);
			
			return result;
		}
		
		public ResultObj GetAllCTPhieuHangTra( )
        		{
			ResultObj result = new ResultObj();
			CTPhieuHangTraDAO ctphieuhangtraDAO = new CTPhieuHangTraDAO();
			result = ctphieuhangtraDAO.GetAllCTPhieuHangTra();
			
			return result;
		}
		
		public ResultObj GetCTPhieuHangTraById(CTPhieuHangTra ctphieuhangtra)
        		{
			ResultObj result = new ResultObj();
			CTPhieuHangTraDAO ctphieuhangtraDAO = new CTPhieuHangTraDAO();
			result = ctphieuhangtraDAO.GetAllCTPhieuHangTraByID(ctphieuhangtra);
			
			return result;
		}

        public ResultObj GetTongHopHangTra()
        {
            ResultObj result = new ResultObj();
            CTPhieuHangTraDAO ctphieuhangtraDAO = new CTPhieuHangTraDAO();
            result = ctphieuhangtraDAO.GetTongHopHangTra();

            return result;
        }
	}
}
